﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Valentia.Kinection.DataTypes
{
    #region NotificationType Enum
    /// <summary>
    /// Notification type enum.
    /// </summary>    
    public enum NotificationType : int
    {
        /// <summary>
        /// Exception.
        /// </summary>
        Exception,

        /// <summary>
        /// Data extractor is started.
        /// </summary>
        DataExtractorStarted,

        /// <summary>
        /// Data extractor is stopped.
        /// </summary>
        DataExtractorStopped,

        /// <summary>
        /// Kinect device is alread in use by other applicaion.
        /// </summary>
        Kinect_Already_In_Use,

        /// <summary>
        /// Kinect device is initilized by appliction and data extraction is started.
        /// </summary>
        KinectLocked,

        /// <summary>
        /// Kinect device is uninitilized by appliction and data extraction is stopped.
        /// </summary>
        KinectReleased,

        /// <summary>
        /// Kinect device status is changed.
        /// </summary>
        KinectStatusChanged,

        /// <summary>
        /// Skeleton is tracked by the kinect device.
        /// </summary>
        SkeletonTracked,

        /// <summary>
        /// Skeleton is relesead by the kinect device.
        /// </summary>
        SkeletonReleased
    }
    #endregion

    #region KinectColorImageFormat Enum
    /// <summary>
    /// Kinect image format enum.
    /// </summary>
    public enum KinectColorImageFormat : int
    {
        /// <summary>
        /// Undefined.
        /// </summary>
        Undefined = 0,

        /// <summary>
        /// Rgb 640x480 with 30 Fps.
        /// </summary>
        RgbResolution640x480Fps30 = 1,

        /// <summary>
        /// Rgb 1280x960 with 12 Fps.
        /// </summary>
        RgbResolution1280x960Fps12 = 2,

        /// <summary>
        /// Yuv 640x480 with 30 fps.
        /// </summary>
        YuvResolution640x480Fps15 = 3,

        /// <summary>
        /// Raw 640x480 with 15 fps.
        /// </summary>
        RawYuvResolution640x480Fps15 = 4,
    }
    #endregion

    #region KinectDepthImageFormat Enum
    /// <summary>
    /// Kinect image format enum.
    /// </summary>
    public enum KinectDepthImageFormat : int
    {
        /// <summary>
        /// Undefined.
        /// </summary>
        Undefined = 0,

        /// <summary>
        /// 640x480 with 30 fps.
        /// </summary>
        Resolution640x480Fps30 = 1,

        /// <summary>
        /// 320x240 with 30 fps.
        /// </summary>
        Resolution320x240Fps30 = 2,

        /// <summary>
        /// 80x60 with 30 fps.
        /// </summary>
        Resolution80x60Fps30 = 3
    }
    #endregion

    #region KinectClippedEdges Enum
    /// <summary>
    /// Kinect Clipped Edges enum.
    /// </summary>
    [Flags]
    public enum KinectClippedEdges
    {
        /// <summary>
        /// None
        /// </summary>
        None = 0,

        /// <summary>
        /// ClippedRight.
        /// </summary>
        Right = 1,

        /// <summary>
        /// ClippedLeft.
        /// </summary>
        Left = 2,

        /// <summary>
        /// ClippedTop.
        /// </summary>
        Top = 4,

        /// <summary>
        /// ClippedBottom.
        /// </summary>
        Bottom = 8,
    }
    #endregion

    #region SkeletonJointID Enum
    /// <summary>
    /// Skeleton joint ID enum.
    /// </summary>
    public enum SkeletonJointID : int
    {
        /// <summary>
        /// HipCenter
        /// </summary>
        HipCenter = 0,

        /// <summary>
        /// Spine
        /// </summary>
        Spine = 1,

        /// <summary>
        /// ShoulderCenter
        /// </summary>
        ShoulderCenter = 2,

        /// <summary>
        /// Head
        /// </summary>
        Head = 3,

        /// <summary>
        /// ShoulderLeft
        /// </summary>
        ShoulderLeft = 4,

        /// <summary>
        /// ElbowLeft
        /// </summary>
        ElbowLeft = 5,

        /// <summary>
        /// WristLeft
        /// </summary>
        WristLeft = 6,

        /// <summary>
        /// HandLeft
        /// </summary>
        HandLeft = 7,

        /// <summary>
        /// ShoulderRight
        /// </summary>
        ShoulderRight = 8,

        /// <summary>
        /// ElbowRight
        /// </summary>
        ElbowRight = 9,

        /// <summary>
        /// WristRight
        /// </summary>
        WristRight = 10,

        /// <summary>
        /// HandRight
        /// </summary>
        HandRight = 11,

        /// <summary>
        /// HipLeft
        /// </summary>
        HipLeft = 12,

        /// <summary>
        /// KneeLeft
        /// </summary>
        KneeLeft = 13,

        /// <summary>
        /// AnkleLeft
        /// </summary>
        AnkleLeft = 14,

        /// <summary>
        /// FootLeft
        /// </summary>
        FootLeft = 15,

        /// <summary>
        /// HipRight
        /// </summary>
        HipRight = 16,

        /// <summary>
        /// KneeRight
        /// </summary>
        KneeRight = 17,

        /// <summary>
        /// AnkleRight
        /// </summary>
        AnkleRight = 18,

        /// <summary>
        /// FootRight
        /// </summary>
        FootRight = 19,

        /// <summary>
        /// Count
        /// </summary>
        Count = 20,
    }
    #endregion

    #region KinectDeviceStatus Enum
    /// <summary>
    /// Kinect device status enum.
    /// </summary>
    [Flags]
    public enum KinectDeviceStatus : uint
    {
        /// <summary>
        /// Undefined
        /// </summary>
        Undefined = 0,

        /// <summary>
        /// Disconnected
        /// </summary>
        Disconnected = 1,

        /// <summary>
        /// Connected
        /// </summary>
        Connected = 2,

        /// <summary>
        /// Initializing
        /// </summary>
        Initializing = 3,

        /// <summary>
        /// Error
        /// </summary>
        Error = 4,

        /// <summary>
        /// Not Powered
        /// </summary>
        NotPowered = 5,

        /// <summary>
        /// Not Ready
        /// </summary>
        NotReady = 6,

        /// <summary>
        /// Device Not Genuine
        /// </summary>
        DeviceNotGenuine = 7,

        /// <summary>
        /// Device Not Supported
        /// </summary>
        DeviceNotSupported = 8,

        /// <summary>
        /// Insufficient Bandwidth
        /// </summary>
        InsufficientBandwidth = 9,

        /// <summary>
        /// Not active.
        /// </summary>
        NotActive = 1000

        #region OLD ENUM VALUES COMMENTED
        ///// <summary>
        ///// Connected.
        ///// </summary>
        //Connected = 0,

        ///// <summary>
        ///// Error
        ///// </summary>
        //Error = 2147483648,

        ///// <summary>
        ///// Disconnected
        ///// </summary>
        //Disconnected = 2197880852,

        ///// <summary>
        ///// NotReady
        ///// </summary>
        //NotReady = 2197880853,

        ///// <summary>
        ///// NotPowered
        ///// </summary>
        //NotPowered = 2197881471,

        ///// <summary>
        ///// Not active.
        ///// </summary>
        //NotActive
        #endregion
    }
    #endregion

    #region ServiceClientType Enum
    /// <summary>
    /// Client types which connects with server
    /// </summary>
    public enum ServiceClientType : int
    {
        /// <summary>
        /// RTC Server
        /// </summary>
        RTCServer = 1,

        /// <summary>
        /// Web Client via web socket
        /// </summary>
        WebClient = 2
    }
    #endregion

    #region Connectivity Status Enum

    /// <summary>
    /// Connectivity status of device and service client
    /// </summary>
    public enum ConnectivityStatus : int
    {
        /// <summary>
        /// Only service client is connected
        /// </summary>
        OnlyServiceClientConnected = 1,

        /// <summary>
        /// Only kinect device is connected
        /// </summary>
        OnlyDeviceConnected = 2,

        /// <summary>
        /// Service client and kinect device both are connected
        /// </summary>
        BothConnected = 3,

        /// <summary>
        /// Service client and kinect device both are disconnected
        /// </summary>
        BothDisconnected = 4
    }

    #endregion

    #region Remoting Client Commands Enum

    /// <summary>
    /// Connectivity status of device and service client
    /// </summary>
    public enum ClientCommands : int
    {
        /// <summary>
        /// Client connected
        /// </summary>
        ClientConnected = 1,

        /// <summary>
        /// Send list of connected kinect devices
        /// </summary>
        SendDevicesConnectivity = 2,

        /// <summary>
        /// Send list of connected service clients
        /// </summary>
        SendClientsConnectivity = 3,

        /// <summary>
        /// Send connectivity status and count of clients
        /// </summary>
        SendConnectivityStatus = 4,

        /// <summary>
        /// Move kinect device upwards
        /// </summary>
        MoveDeviceUp = 5,

        /// <summary>
        /// Move kinect device downwards
        /// </summary>
        MoveDeviceDown = 6,
    }

    #endregion
}
